

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>

</title><link href='./home/css/etm.css' rel='stylesheet' type='text/css' /><!--[if IE 8]> <link href='/Themes/Theme3/ie8Fix.css' rel='stylesheet' /> <![endif]-->

    <script src="./home/js/WdatePicker.js"></script>
    <script src="./home/js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript">
        window.parent.showsending(false, "");
        function SelectMember(navId) {
            window.parent.showDialog("选择幼儿", "../../Modules/CRM/SelectMultiMembers.aspx?navId="+navId+"&multiLayer=0&MemberType=0&act=msg","960px", "450px");
        }
        function FillInput_Multi(data)
        {
            var mobileJson=JSON.parse(data);
            var c = $("#txtMobile").val();
            var Phonearry=c.split(',');
            var isExist=false;
            var mobileStr="";
            for(var i=0;i<mobileJson.length;i++)
            {
                isExist=false;
                for(var j=0;j<Phonearry.length;j++)
                {
                    if(mobileJson[i].Mobile.toLocaleLowerCase()==Phonearry[j].toLocaleLowerCase())
                    {
                        isExist = true;
                    }
                }
                if(!isExist)
                {
                    mobileStr+=mobileJson[i].Mobile+",";                   
                }

            }
            if(mobileStr!="")
            {
                mobileStr=mobileStr.substring(0,mobileStr.length-1);
                if(c!=""){
                    $("#txtMobile").val(c + "," + mobileStr);
                }
                else
                {
                    $("#txtMobile").val(mobileStr);
                }
            }
            parent.parent.ShowTips("电话号码添加成功！");
        }
        function FillInput(v) {           
            if($.trim(v).length > 0) {
                var c = $("#txtMobile").val();
                if(c.length > 0){
                    ifPhone(c,v);                   
                }
                else
                {
                    $("#txtMobile").val(v);
                }
            }
        }
        //判断是否重复
        function ifPhone(c,v)
        {
            var isExist = false;
            if(c.toLocaleLowerCase()==v.toLocaleLowerCase())
            {
                isExist = true;
            }
            var Phonearry=c.split(',');
            for(var i=0;i<Phonearry.length;i++)
            {
                if(v.toLocaleLowerCase()==Phonearry[i].toLocaleLowerCase())
                {
                    isExist = true;
                }
            }
            if (isExist) {
                parent.parent.ShowTips(v+"电话号码已添加！");
            }
            else
            {
                $("#txtMobile").val(c + "," + v);
                parent.parent.ShowTips("电话号码添加成功！");
            }
        }
    </script>
    <meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE"/><script src='/Scripts/jquery.nicescroll.min.js' type='text/javascript'></script><script type='text/javascript'>var isEtmClient=false;function ReSizeScrollbar() { if ($('form').getNiceScroll().length > 0) {     $('form').getNiceScroll().onResize();}}function ReSizeFlexgridScrollbar() { if ($('.bDiv').getNiceScroll().length > 0) {     $('.bDiv').getNiceScroll().onResize();}}function InitFlexgridScrollbar(){     $('.bDiv').niceScroll({cursorcolor: '#75A801',zindex:4});}function ReSizenDivScrollbar() { if ($('.flexigrid .nDiv').getNiceScroll().length > 0) {     $('.flexigrid .nDiv').getNiceScroll().onResize();}}function InitnDivScrollbar(){     $('.flexigrid .nDiv').niceScroll({cursorcolor: '#75A801',horizrailenabled:false});}function proxyExecuteFun(funName) {if(funName == undefined || funName==null|| funName.length==0){window.parent.showsending(true, "执行中，请耐心等待");setTimeout(function() { window.parent.showsending(false); }, 5000);return;}  if (window[funName]()) {window.parent.showsending(true, "执行中，请耐心等待");setTimeout(function() { window.parent.showsending(false); }, 5000);return true; } return false; };var _tmpOnSelectedFile = null;function onSelectedFile(fileName, fileUrl, isImg) {   if (_tmpOnSelectedFile != null) {        _tmpOnSelectedFile(fileName, fileUrl, isImg);    }}function showFileList(callback) {   window.parent.showDialog('查看素材库', '/Modules/OA/CMyFileListView.aspx?navId=ac6a8920-e708-40e1-86a1-5df7ec49cede', '900px', '450px');   _tmpOnSelectedFile = callback;}$(function () {if (navigator.userAgent.toLowerCase().indexOf('edge/') != -1) { $('input[type=submit],.tmpSubmitButton').bind({ mouseenter: function () { $(this).addClass('tmpSubmitButton'); $(this).prop('type', 'button'); }, mouseleave: function () { $(this).removeClass('tmpSubmitButton'); $(this).prop('type', 'submit'); }, click: function () { $(this).removeClass('tmpSubmitButton'); $(this).prop('type', 'submit'); } }); }if (window.parent != undefined && window.parent != null && typeof window.parent.showsending != "undefined") { window.parent.showsending(false, ''); }$(".button").each(function() { if ($(this).attr("type") == "submit" &&!$(this).hasClass('noloading') && window.parent != undefined && window.parent != null && typeof window.parent.showsending != "undefined") { var tmpClick = $(this).attr("onclick");if(tmpClick == undefined || tmpClick==null|| tmpClick.length<2){ $(this).attr("onclick","proxyExecuteFun();");return;}  if (tmpClick.indexOf("return ") != -1 && tmpClick.indexOf("(") != -1) { tmpClick = tmpClick.substring(7).replace(/\s+/g, ''); if (tmpClick.indexOf("()") != -1) { var funName = tmpClick.substring(0, tmpClick.indexOf("(")); $(this).attr("onclick","return proxyExecuteFun('" + funName + "');"); } } } });$('body').click(function() {     if (typeof parent.onChildPageClick !='undefined') {         parent.onChildPageClick();     }});     $('form').height($(window).height()-0).niceScroll({cursorcolor: '#75A801',horizrailenabled:false });     $(window).resize(function () {         ReSizeScrollbar();     });});</script></head>
<body>
    <form method="post" action="SendMsg.aspx?navId=ac6a8920-e708-40e1-86a1-5df7ec49cede" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTIxMTk0NzMwMzUPZBYCAgMPZBYIAgEPEGQQFQEJ6K+36YCJ5oupFQEBMBQrAwFnFgFmZAIDDw8WAh4EVGV4dAUCNjdkZAIGDxBkEBUYBTAw54K5BTAx54K5BTAy54K5BTAz54K5BTA054K5BTA154K5BTA254K5BTA354K5BTA454K5BTA554K5BTEw54K5BTEx54K5BTEy54K5BTEz54K5BTE054K5BTE154K5BTE254K5BTE354K5BTE454K5BTE554K5BTIw54K5BTIx54K5BTIy54K5BTIz54K5FRgCMDACMDECMDICMDMCMDQCMDUCMDYCMDcCMDgCMDkCMTACMTECMTICMTMCMTQCMTUCMTYCMTcCMTgCMTkCMjACMjECMjICMjMUKwMYZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZGQCBw8QZBAVDAUwMOWIhgUwNeWIhgUxMOWIhgUxNeWIhgUyMOWIhgUyNeWIhgUzMOWIhgUzNeWIhgU0MOWIhgU0NeWIhgU1MOWIhgU1NeWIhhUMAjAwAjA1AjEwAjE1AjIwAjI1AjMwAjM1AjQwAjQ1AjUwAjU1FCsDDGdnZ2dnZ2dnZ2dnZ2RkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBQljYlNldFRpbWXgJN7+sJiNpTM0nb2ZEcgB1XxTkjD4oSPjwSsF3a1pbg==" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>


<div class="aspNetHidden">

	<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="D373E79B" />
	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdACxJNzrTJVnyaT/WiDqlW535FcTd2TBrVxEAJVrcwengG2QT9tOCVB9ehxyUPN9ICH68FdwUuHh+a2npCkAauQLBf1eE0BJQfV7kq1TWrjzF2DYA7WcSyumedz0tKEJUeuTA6S1mPdv7zuhHh5m/ur+lmzvXkHokhdU8fmzR+apy1D48axxCfA3Wq4xpkNBuPBiBpvml25qgNhq6OxSwk1fzxPGiu7fSaJU17nEKqidelbCpZuS8FcpNY84zxzQe+6bJY5Ql6vvme/V43sdS60fZ2nixxLjJ259/riweC2lO7EgRQuQ1jGdG4ThFKE1AWeZ/e/OX1MC/xyowEhszOcZQhdEjZsBzlzFwF751MargZrgIV8Odzszl2lBqR9FgNglj/ypvQ4A88wa+4vzq6Iq/c/Un6MdPkArKmom3mc6AbpAGdKNrLzRI44eECLg68X9BglzCV85aJPYZ31cJbM8D5662dG04tF9wW7s7TxogIDMPNlppAJ7WpGC7mJv/TTONiuoY0fWHuaW9u6lBSi/HpKM4CYEG+FxhofAU9k2o6GKoo3p1ojynWBqqjfPkfQ+T2vKYIJkUQfZX8TL+6Wwa8Q6smW1wiA+cV5iomgwo1DrO7DXdT3RmInZnwA313K3bRciWNHgKfUagir0r5WFm+jVot+KhCsRezO+l6ryakCQHZ0odGbX3/4aa3kL/ZEVs+q7Bg41SKKm+/Zds7D9YdcmFqOvKlX8KfSOcNyx9L+oGzEGw3mfvb8Kj+KbPrnADy0r47QQgXx/+0VxzGCTguu4BQMRnC5/UAvOmpszQyaR/Pd/SGJtWh3xPnyHR6ZPgsqLw7oWjL0oOn9ursgYCsObonAgXzuH0bQDZlv97UDP2DugbIF4264Wi1DfqBdk3eXHYJa35R6emegT3roiqEp6Qm6qqBgGb8BmZ9HFEDglRdTjcHK+QQNQvz+5ewzyl3obU6940Gsz8LBTxp03s" />
</div>
        <table class="edit">
            <tr>
                <td class="textAlignRight" style="width: 80px;">手机号码：
                    <p>
                        <input type="button" class="button" value="选取" onclick="SelectMember('ac6a8920-e708-40e1-86a1-5df7ec49cede    ');" style="width: 50px; margin-right: 10px;" /></p>
                </td>
                <td>
                    <textarea name="txtMobile" rows="2" cols="20" id="txtMobile" class="int" style="width: 550px; height: 120px;">
</textarea>
                    * 多个号码，用<em class="words"> 逗号 </em>或<em class="words"> 换行 </em>
                    分隔，重复号码自动过滤
                </td>
            </tr>
            <tr>
                <td class="textAlignRight">短信模板：
                </td>
                <td>
                    <select name="ddlTemplate" onchange="javascript:setTimeout(&#39;__doPostBack(\&#39;ddlTemplate\&#39;,\&#39;\&#39;)&#39;, 0)" id="ddlTemplate" class="int">
	<option selected="selected" value="0">请选择</option>

</select>
                </td>
            </tr>
            <tr>
                <td class="textAlignRight">短信内容：
                </td>
                <td>
                    <textarea name="txtContents" rows="2" cols="20" id="txtContents" class="int" onkeyup="count();" style="width: 550px; height: 200px;">
</textarea>
                    <span id="msg" class="words" style="margin-left: 10px;">0</span> /
                    <span id="lbMsgWordLimit" style="margin-right: 10px;">67</span>
                    发送时自动追加签名：<span class="words"></span>
                </td>
            </tr>
            <tr>
                <td class="textAlignRight">定时发送：
                </td>
                <td>
                    <input id="cbSetTime" type="checkbox" name="cbSetTime" />
                    <span id="setTime" style="display: none;">设定时间：
                        <input name="txtSetTime" type="text" value="2017-03-08" id="txtSetTime" class="int" onfocus="WdatePicker({dateFmt:&#39;yyyy-MM-dd&#39;})" style="width: 80px" />
                        <select name="ddlHour" id="ddlHour">
	<option value="00">00点</option>
	<option value="01">01点</option>
	<option value="02">02点</option>
	<option value="03">03点</option>
	<option value="04">04点</option>
	<option value="05">05点</option>
	<option value="06">06点</option>
	<option value="07">07点</option>
	<option value="08">08点</option>
	<option value="09">09点</option>
	<option value="10">10点</option>
	<option value="11">11点</option>
	<option value="12">12点</option>
	<option selected="selected" value="13">13点</option>
	<option value="14">14点</option>
	<option value="15">15点</option>
	<option value="16">16点</option>
	<option value="17">17点</option>
	<option value="18">18点</option>
	<option value="19">19点</option>
	<option value="20">20点</option>
	<option value="21">21点</option>
	<option value="22">22点</option>
	<option value="23">23点</option>

</select>
                        <select name="ddlMinute" id="ddlMinute">
	<option value="00">00分</option>
	<option value="05">05分</option>
	<option value="10">10分</option>
	<option value="15">15分</option>
	<option value="20">20分</option>
	<option value="25">25分</option>
	<option value="30">30分</option>
	<option value="35">35分</option>
	<option value="40">40分</option>
	<option value="45">45分</option>
	<option value="50">50分</option>
	<option value="55">55分</option>

</select>
                    </span>
                </td>
            </tr>
            <tr>
                <td colspan="2" class="borderBottom"></td>
            </tr>
            <tr>
                <td class="textAlignRight"></td>
                <td>
                    <input type="submit" name="btnSend" value="发 送" onclick="return check();" id="btnSend" class="button" />
                    <div>&nbsp;</div>
                    <span id="lbSendResult"></span>
                    <br />
                    <span id="lbFailMobile" class="words"></span>
                </td>
            </tr>
        </table>

        <script type="text/javascript">
            function count() {
                document.getElementById("msg").innerHTML = document.getElementById("txtContents").value.length;
            }
            function check() {
                if ($("#txtMobile").val() == '') {
                    alert('手机号码不能为空！');
                    return false;
                }
                if ($("#txtContents").val() == '') {
                    alert('短信内容不能为空！');
                    return false;
                }
                else {

                    if ($.trim($("#txtContents").val()).length + parseInt('0') > 500) {
                        alert('短信内容（自动追加签名：0）不能超过500字！');
                        return false;
                    }
                }
                if ($("#cbSetTime").attr("checked") == "checked") {
                    if ($("#txtSetTime").val() != '') {
                        var reg = /\d{4}-\d{2}-\d{2}/;
                        if (!reg.test($("#txtSetTime").val())) {
                            alert('设定日期格式不正确！');
                            return false;
                        }
                        else {
                            var setTime = $("#txtSetTime").val().replace(/-/g, "") + $("#ddlHour").val() + $("#ddlMinute").val() + '00';
                            var currentTime = "";
                            var nowDate = new Date();
                            var year = nowDate.getFullYear();
                            var month = parseInt(nowDate.getMonth().toString()) + 1; //month是从0开始计数的，因此要 + 1
                            if (month < 10) {
                                month = "0" + month.toString();
                            }
                            var date = nowDate.getDate();
                            if (date < 10) {
                                date = "0" + date.toString();
                            }
                            var hour = nowDate.getHours();
                            if (hour < 10) {
                                hour = "0" + hour.toString();
                            }
                            var minute = nowDate.getMinutes();
                            if (minute < 10) {
                                minute = "0" + minute.toString();
                            }
                            var second = nowDate.getSeconds();
                            if (second < 10) {
                                second = "0" + second.toString();
                            }
                            currentTime = year.toString() + month.toString() + date.toString() + hour.toString() + minute.toString() + second.toString();
                            if (setTime <= currentTime) {
                                alert('设定短信定时发送时间必须大于当前时间！');
                                return false;
                            }
                        }
                    }
                    else {
                        alert('定时发送短信必须设定发送时间！');
                        return false;
                    }
                }

                window.parent.showsending(true, "短信发送中，请耐心等待...");
                return true;
            }
            $(function () {
                if (false) {
                    $("#cbSetTime").attr("checked", "checked");
                $("#setTime").show();
            }
                else {
                    $("#cbSetTime").attr("checked", false);
                $("#setTime").hide();
                }
                $("#cbSetTime").click(function () {
                    if ($(this).attr("checked") == "checked") {
                        $("#setTime").show();
                    }
                    else {
                        $("#setTime").hide();
                    }
                });
                });
        </script>

    </form>
</body>
</html>
